package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ch.zbw.pra.sysventory.model.Printer;

/**
 * Mapping von einem Resultset auf ein Printer Objekt
 * 
 * @author Roberto Lucas
 */

public class PrinterMapper implements RowMapper<Printer>, Serializable {

	private static final long serialVersionUID = -6944752920712076498L;

	public Printer mapRow(ResultSet rs, int rowNum) throws SQLException {
		Printer printer = new Printer();
		printer.setPrinterId(rs.getInt("prinID_pk"));
		printer.setNamePrinter(rs.getString("prinName"));
		printer.setDriverNamePrinter(rs.getString("prinDriverName"));
		printer.setDriverVersionPrinter(rs.getString("prinVersion"));
		return printer;
	}
}
